//
//  BlockGetAFNYiBu.m
//  UI_封装AFN
//
//  Created by mac on 15/9/10.
//  Copyright (c) 2015年 lanou3g.com蓝欧科技. All rights reserved.
//

#import "BlockGetAFNYiBu.h"

@implementation BlockGetAFNYiBu

+ (void)GetAfnURLWithString:(NSString *)urlStr resultBlock:(BlockGetAfnResult)resultBlcok errorBlcok:(BlcokGetAfnError)errorBlcok
{
    AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
    // 设置网络请求格式
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/json",@"application/json",@"text/javascript",@"text/html",nil];
    [manager GET:urlStr parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        resultBlcok(responseObject);
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        errorBlcok(error);
        
    }];
}
@end
